<template>
	<view class="archives">
		<view class="archivesMessage">
			<view class="topBox">
				<image src="../../static/image/iconfool.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
				<view class="text">
				</view>
			</view>
			<view class="contentBox">
				<view class="contentitem">
					<view class="lable">
						中文名称
					</view>
					<view class="value">
						{{pageData.name == null ? '中文名称' : pageData.name}}
					</view>
				</view>
				<view class="contentitem">
					<view class="lable">
						英文名称
					</view>
					<view class="value">
						{{pageData.nickname == null ? '英文名称' : pageData.nickname}}
					</view>
				</view>
				<view class="contentitem">
					<view class="lable">
						在读学校
					</view>
					<view class="value">
						{{pageData.school == null ? '在读学校' : pageData.school}}
					</view>
				</view>
				<view class="contentitem">
					<view class="lable">
						在读国家
					</view>
					<view class="value">
						{{pageData.country == null ? '在读国家' : pageData.country}}
					</view>
				</view>
				<view class="contentitem">
					<view class="lable">
						合同起始日期
					</view>
					<view class="value">
						{{pageData.contract_start_time == null ? '合同起始日期' : pageData.contract_start_time}}
					</view>
				</view>
				<view class="contentitem">
					<view class="lable">
						合同结束日期
					</view>
					<view class="value">
						{{pageData.contract_end_time == null ? '合同结束日期' : pageData.contract_end_time}}
					</view>
				</view>
				<view class="contentitem">
					<view class="lable">
						目前年级
					</view>
					<view class="value">
						{{pageData.age == null ? '目前年级' : pageData.age}}
					</view>
				</view>
				<view class="contentitem" style="border-bottom: none;">
					<view class="lable">
						课程体系
					</view>
					<view class="value">
						{{pageData.course == null ? '课程体系' : pageData.course}}
					</view>
				</view>
			</view>
		</view>

		<view v-if="pageData.remark != null" class="remarkBox">
			<view class="remarktext">
				备注:
			</view>
			<view class="" style="margin-top: 20rpx;">
				{{pageData.remark == null ? '' : pageData.remark}}
			</view>
		</view>

		<view v-if="pageData.remark_image.length" class="imgBox">
			<image class="imgitem" v-for="(item,index) in pageData.remark_image" :src="item" mode=""
				style="width: 140rpx;height: 140rpx;" @click="handleimg(pageData.remark_image)"></image>
		</view>


	</view>
</template>

<script>
	import {
		filesDetail
	} from "@/api/api.js"
	export default {
		data() {
			return {
				pageId: "",
				pageData: {},
			}
		},
		onLoad(options) {
			// console.log("opions", options)
			this.pageId = options.id
			this.handleDetail()
		},
		methods: {
			async handleDetail() {
				let res = await filesDetail({
					id: this.pageId
				})
				this.pageData = res.data
				if (this.pageData.remark_image == "") {
					this.pageData.remark_image = []
				} else {
					this.pageData.remark_image = this.pageData.remark_image.split(",")
				}
				// console.log("学生档案", this.pageData.remark_image)
			},
			handleimg(imgarr) {
				uni.previewImage({
					current: 0, // 当前显示图片的链接（必填）
					urls: imgarr, // 要预览的图片链接列表（必填）
					success() {
						// console.log('预览图片成功');
					},
					fail(err) {
						// console.log('预览图片失败', err);
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.archives {
		.archivesMessage {
			width: 690rpx;
			height: 712rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin: 0 auto;
			margin-top: 30rpx;
			position: relative;

			.topBoximg {
				width: 690rpx;
				height: 92rpx;
				position: absolute;
				top: 0;
				bottom: 0;
			}

			.topBox {
				width: 100%;
				height: 92rpx;
				padding: 22rpx 20rpx;
				box-sizing: border-box;
				display: flex;
				align-items: center;

				.text {
					font-size: 32rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					color: #255A9B;
					line-height: 32rpx;
					margin-left: 20rpx;
				}
			}

			.contentBox {
				padding: 0 20rpx;
				box-sizing: border-box;

				.contentitem {
					display: flex;
					align-items: center;
					justify-content: space-between;
					height: 76rpx;
					border-bottom: 1rpx solid #F4F4F7;

					.lable {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #212121;
						line-height: 28rpx;
					}

					.value {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #999996;
						line-height: 28rpx;
					}

					input {
						text-align: right;
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						line-height: 28rpx;
					}
				}
			}
		}

		.remarkBox {
			width: 690rpx;
			// height: 288rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin: 0 auto;
			margin-top: 30rpx;
			padding: 30rpx;
			box-sizing: border-box;
			font-size: 28rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			// color: #999996;
			line-height: 28rpx;
		}
		.remarktext {
			width: 100%;
			word-wrap: break-word;
		}

		.imgBox {
			display: flex;
			flex-wrap: wrap;
			margin-top: 20rpx;
			width: 100%;
			padding: 30rpx;
			box-sizing: border-box;
			background-color: #ffffff;

			.imgitem {
				margin-right: 30rpx;
				border-radius: 10rpx;
			}
		}
	}
</style>